/*
 * @Description: 获取用户
 * @Author: along
 * @Date: 2020-04-06
 * @Last Modified by: along
 * @Last Modified time: --
 */
export default {
    methods: {
        getUserInfo(callback) {
            let _this = this;

            this.$post('', {}).then((resp) => {
                if (resp.code == 1) {
                    _this.$store.commit('userInfo/SET_USER_INFO', resp.data);
                    if(callback){
                        callback(resp.data);
                    }
                } else {
                    _this.$notify.error({
                        title: '错误',
                        duration: 2000,
                        message: resp.msg || '获取用户信息失败，请稍后重试'
                    });
                }
            });
        }
    }
};